Release 10.1A: OpenEdge Data Management:
SQL Development
Working with SQL column widths
A Progress 4GL database can contain fields, also referred to as columns, of variable length. However, SQL
CREATE TABLEstatements specify the maximum width of each column in a table. 4GL programs have the ability to insert data whose length exceeds the Data Dictionary value ofSQLWidth. SQL applications will not be able to read a row if a column contains data greater than theSQLWidthvalue defined in the Data Dictionary.Two tools enable you to compensate for column width discrepancies:
Using the -checkwidth startup parameter
OpenEdge 4GL programmers can override Data Dictionary column definitions in 4GL programs. Therefore, a SQL application cannot read a record if a column contains data greater than the
SQLWidthvalue defined in the Data Dictionary. An attempt to retrieve a column that exceeds theSQLWidthdefinition generates an error message, and the attempt to access the record fails.Use the
-checkwidthstartup parameterto specify whether Progress comparesCHARACTER,DECIMAL, andRAWfield data against the metaschema_widthfield value before updating a database record. The_widthfield value specifies the maximum width of the data allowed in a field.The syntax for the
-checkwidthstartup parameter is:
The -
checkwidthstartup parameter can be employed in the following modes:
- 0 — Ignore the
_widthfield value and store the data. This is the default mode.- 1 — Store the data and generate a warning message if the data exceeds the size specified in the
_widthfield.- 2 — Do not store data that exceeds the size specified in the
_widthfield and generate an error. Specify this mode if you want the Progress 4GL to behave like SQL.For more information on the
-checkwidthstartup parameter, see OpenEdge Deployment: Startup Command and Parameter Reference .Using the DBTool utility
The
DBToolutility allows Progress users to identify when the size of column data in the database exceeds the Data Dictionary definition and therefore theSQLWidthvalue. TheDBToolutility addresses this situation because it allows for the fast updating of Data DictionarySQLWidthdefinitions.The following error message is reported to a SQL application when the
SQLWidthfor a column exceeds the Data DictionarySQLWidthdefinition:
The syntax for
DBToolis:
![]()
To access DBTool from the command line:
- Type dbtool and the database name and press Enter. The DBTool option menu appears:
![]()
- Select an option from the menu and press Enter.
Table 7–2 describes the options available in the DBTool option menu.
For more information on the
DBToolutility, see OpenEdge Data Management: Database Administration .
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |